<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button message="admin" class="cc">btn1</button>
    <button message="zhangsan">btn2</button>
    <script>
        let arr = [1,3,32];
        // dom元素借用数组的过滤方法
        let btns = document.querySelectorAll('button');
        btns = Array.prototype.filter.call(btns,item=>{
            return item.hasAttribute('class');
        })
        console.log(btns)
        
    </script>
</body>
</html>